#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Intesim Python Script

Window.initCadWindow()
Window.setView('topView')
gl.Parameter('X1', 12.8)
CAD.addParameter('X1')
CAD.recomputeby('X1')
gl.Parameter('X2', 33.4)
CAD.addParameter('X2')
CAD.recomputeby('X2')
gl.Parameter('R1', 8)
CAD.addParameter('R1')
CAD.recomputeby('R1')
gl.Parameter('R2', 3.4)
CAD.addParameter('R2')
CAD.recomputeby('R2')
gl.Parameter('R3', 6.0)
CAD.addParameter('R3')
CAD.recomputeby('R3')
gl.Parameter('R4', 2)
CAD.addParameter('R4')
CAD.recomputeby('R4')
gl.Parameter('R5', 6)
CAD.addParameter('R5')
CAD.recomputeby('R5')
# 衔铁位置DIST最小值 = 0， DIST最大值 = 4.8
gl.Parameter('DIST', 2.1)
CAD.addParameter('DIST')
CAD.recomputeby('DIST')

sketch = CAD.addSketch('sketch')
sketch.setRotation(0, 0, 0, 1)
CAD.getSketch('sketch').addPoint(CAD.Point(10.5, 3.8))
CAD.getSketch('sketch').addPoint(CAD.Point(21.6, 3.8))
CAD.getSketch('sketch').addPoint(CAD.Point(21.6, 38.2))
CAD.getSketch('sketch').addPoint(CAD.Point(10.5, 38.2))
Model.updateSolverList()
Model.updateSolverList()
CAD.recompute()
Window.setView('fitView')
CAD.getObject('sketch').label = 'coil'
CAD.getSketch('sketch').addLine(start = CAD.Point(10.5, 3.8), end = CAD.Point(21.6, 3.8), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.Start, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.End, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Horizontal, geo_1='line1')
CAD.getSketch('sketch').addLine(start = CAD.Point(21.6, 3.8), end = CAD.Point(21.6, 38.2), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.Start, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.End, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Vertical, geo_1='line2')
CAD.getSketch('sketch').addLine(start = CAD.Point(21.6, 38.2), end = CAD.Point(10.5, 38.2), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.Start, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.End, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Horizontal, geo_1='line3')
CAD.getSketch('sketch').addLine(start = CAD.Point(10.5, 38.2), end = CAD.Point(10.5, 3.8), construction = False)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.Start, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.End, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch').addConstraint(type=ConstraintType.Vertical, geo_1='line4')
CAD.recompute()

sketch = CAD.addSketch('sketch001')
sketch.setRotation(0, 0, 0, 1)
CAD.getSketch('sketch001').addPoint(CAD.Point(0, 0))
CAD.getSketch('sketch001').addPoint(CAD.Point(0, 1))
CAD.getSketch('sketch001').addPoint(CAD.Point(%R5%, 1))
CAD.getSketch('sketch001').addPoint(CAD.Point(%R5%, 23.4))
CAD.getSketch('sketch001').addPoint(CAD.Point(7, 23.4))
CAD.getSketch('sketch001').addPoint(CAD.Point(7, %X2%))
CAD.getSketch('sketch001').addPoint(CAD.Point(9, %X2%))
CAD.getSketch('sketch001').addPoint(CAD.Point(9, 2))
CAD.getSketch('sketch001').addPoint(CAD.Point(19, 2))
CAD.getSketch('sketch001').addPoint(CAD.Point(19, 1))
CAD.getSketch('sketch001').addPoint(CAD.Point(23.1, 1))
CAD.getSketch('sketch001').addPoint(CAD.Point(23.1, 40))
CAD.getSketch('sketch001').addPoint(CAD.Point(2.55, 40))
CAD.getSketch('sketch001').addPoint(CAD.Point(2.55, 41.8))
CAD.getSketch('sketch001').addPoint(CAD.Point(23.1, 41.8))
CAD.getSketch('sketch001').addPoint(CAD.Point(23.1, 57.6))
CAD.getSketch('sketch001').addPoint(CAD.Point(25.5, 57.6))
CAD.getSketch('sketch001').addPoint(CAD.Point(25.5, 57.1))
CAD.getSketch('sketch001').addPoint(CAD.Point(24.15, 57.1))
CAD.getSketch('sketch001').addPoint(CAD.Point(24.15, 0))
Model.updateSolverList()
Model.updateSolverList()
CAD.getObject('sketch001').label = 'fix'
CAD.getSketch('sketch001').addLine(start = CAD.Point(0, 0), end = CAD.Point(0, 1), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.Start, geo_2='axis_x', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.End, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addLine(start = CAD.Point(0, 1), end = CAD.Point(%R5%, 1), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.Start, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.End, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line2')
CAD.getSketch('sketch001').addLine(start = CAD.Point(%R5%, 1), end = CAD.Point(%R5%, 23.4), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.Start, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.End, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line3')
CAD.getSketch('sketch001').addLine(start = CAD.Point(%R5%, 23.4), end = CAD.Point(7, 23.4), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.Start, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.End, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line4')
CAD.getSketch('sketch001').addLine(start = CAD.Point(7, 23.4), end = CAD.Point(7, %X2%), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.Start, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.End, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line5')
CAD.getSketch('sketch001').addLine(start = CAD.Point(7, %X2%), end = CAD.Point(9, %X2%), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.Start, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.End, geo_2='vertex7', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line6')
CAD.getSketch('sketch001').addLine(start = CAD.Point(9, %X2%), end = CAD.Point(9, 2), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.Start, geo_2='vertex7', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.End, geo_2='vertex8', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line7')
CAD.getSketch('sketch001').addLine(start = CAD.Point(9, 2), end = CAD.Point(19, 2), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line8', pos_1=PointPos.Start, geo_2='vertex8', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line8', pos_1=PointPos.End, geo_2='vertex9', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line8')
CAD.getSketch('sketch001').addLine(start = CAD.Point(19, 2), end = CAD.Point(19, 1), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line9', pos_1=PointPos.Start, geo_2='vertex9', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line9', pos_1=PointPos.End, geo_2='vertex10', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addLine(start = CAD.Point(19, 1), end = CAD.Point(23.1, 1), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line10', pos_1=PointPos.Start, geo_2='vertex10', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line10', pos_1=PointPos.End, geo_2='vertex11', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line10')
CAD.getSketch('sketch001').addLine(start = CAD.Point(23.1, 1), end = CAD.Point(23.1, 40), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line11', pos_1=PointPos.Start, geo_2='vertex11', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line11', pos_1=PointPos.End, geo_2='vertex12', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line11')
CAD.getSketch('sketch001').addLine(start = CAD.Point(23.1, 40), end = CAD.Point(2.55, 40), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line12', pos_1=PointPos.Start, geo_2='vertex12', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line12', pos_1=PointPos.End, geo_2='vertex13', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line12')
CAD.getSketch('sketch001').addLine(start = CAD.Point(2.55, 40), end = CAD.Point(2.55, 41.8), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line13', pos_1=PointPos.Start, geo_2='vertex13', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line13', pos_1=PointPos.End, geo_2='vertex14', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addLine(start = CAD.Point(2.55, 41.8), end = CAD.Point(23.1, 41.8), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line14', pos_1=PointPos.Start, geo_2='vertex14', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line14', pos_1=PointPos.End, geo_2='vertex15', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line14')
CAD.getSketch('sketch001').addLine(start = CAD.Point(23.1, 41.8), end = CAD.Point(23.1, 57.6), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line15', pos_1=PointPos.Start, geo_2='vertex15', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line15', pos_1=PointPos.End, geo_2='vertex16', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line15')
CAD.getSketch('sketch001').addLine(start = CAD.Point(23.1, 57.6), end = CAD.Point(25.5, 57.6), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line16', pos_1=PointPos.Start, geo_2='vertex16', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line16', pos_1=PointPos.End, geo_2='vertex17', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addLine(start = CAD.Point(25.5, 57.6), end = CAD.Point(25.5, 57.1), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line17', pos_1=PointPos.Start, geo_2='vertex17', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line17', pos_1=PointPos.End, geo_2='vertex18', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addLine(start = CAD.Point(25.5, 57.1), end = CAD.Point(24.15, 57.1), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line18', pos_1=PointPos.Start, geo_2='vertex18', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line18', pos_1=PointPos.End, geo_2='vertex19', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addLine(start = CAD.Point(24.15, 57.1), end = CAD.Point(24.15, 0), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line19', pos_1=PointPos.Start, geo_2='vertex19', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line19', pos_1=PointPos.End, geo_2='vertex20', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Vertical, geo_1='line19')
CAD.getSketch('sketch001').addLine(start = CAD.Point(24.15, 0), end = CAD.Point(0, 0), construction = False)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line20', pos_1=PointPos.Start, geo_2='vertex20', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Coincident, geo_1='line20', pos_1=PointPos.End, geo_2='axis_x', pos_2=PointPos.Start)
CAD.getSketch('sketch001').addConstraint(type=ConstraintType.Horizontal, geo_1='line20')
CAD.recompute()

sketch = CAD.addSketch('sketch002')
sketch.setRotation(0, 0, 0, 1)
CAD.getSketch('sketch002').addPoint(CAD.Point(%R4%, 22.4 +%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(%R4%, 27.7 +%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(%R2%, 27.7 +%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(%R2%, 22.4 +%DIST%+%X1%))
CAD.getSketch('sketch002').addPoint(CAD.Point(5.5, 22.4 +%DIST%+%X1%))
CAD.getSketch('sketch002').addPoint(CAD.Point(5.5, 35 +%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(%R1%, 35 +%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(%R1%, %X2% +%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(%R3%, %X2% +%DIST%))
CAD.getSketch('sketch002').addPoint(CAD.Point(%R3%, 22.4 +%DIST%))
Model.updateSolverList()
Model.updateSolverList()
CAD.getObject('sketch002').label = 'armature'
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R4%, 22.4 +%DIST%), end = CAD.Point(%R4%, 27.7 +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.Start, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line1', pos_1=PointPos.End, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Vertical, geo_1='line1')
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R4%, 27.7 +%DIST%), end = CAD.Point(%R2%, 27.7 +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.Start, geo_2='vertex2', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line2', pos_1=PointPos.End, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Horizontal, geo_1='line2')
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R2%, 27.7 +%DIST%), end = CAD.Point(%R2%, 22.4 +%DIST%+%X1%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.Start, geo_2='vertex3', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line3', pos_1=PointPos.End, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Vertical, geo_1='line3')
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R2%, 22.4 +%DIST%+%X1%), end = CAD.Point(5.5, 22.4 +%DIST%+%X1%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.Start, geo_2='vertex4', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line4', pos_1=PointPos.End, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Horizontal, geo_1='line4')
CAD.getSketch('sketch002').addLine(start = CAD.Point(5.5, 22.4 +%DIST%+%X1%), end = CAD.Point(5.5, 35 +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.Start, geo_2='vertex5', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line5', pos_1=PointPos.End, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addLine(start = CAD.Point(5.5, 35 +%DIST%), end = CAD.Point(%R1%, 35 +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.Start, geo_2='vertex6', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line6', pos_1=PointPos.End, geo_2='vertex7', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Horizontal, geo_1='line6')
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R1%, 35 +%DIST%), end = CAD.Point(%R1%, %X2% +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.Start, geo_2='vertex7', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line7', pos_1=PointPos.End, geo_2='vertex8', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R1%, %X2% +%DIST%), end = CAD.Point(%R3%, %X2% +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line8', pos_1=PointPos.Start, geo_2='vertex8', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line8', pos_1=PointPos.End, geo_2='vertex9', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Horizontal, geo_1='line8')
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R3%, %X2% +%DIST%), end = CAD.Point(%R3%, 22.4 +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line9', pos_1=PointPos.Start, geo_2='vertex9', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line9', pos_1=PointPos.End, geo_2='vertex10', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Vertical, geo_1='line9')
CAD.getSketch('sketch002').addLine(start = CAD.Point(%R3%, 22.4 +%DIST%), end = CAD.Point(%R4%, 22.4 +%DIST%), construction = False)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line10', pos_1=PointPos.Start, geo_2='vertex10', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Coincident, geo_1='line10', pos_1=PointPos.End, geo_2='vertex1', pos_2=PointPos.Start)
CAD.getSketch('sketch002').addConstraint(type=ConstraintType.Horizontal, geo_1='line10')
CAD.recompute()
Window.setView('fitView')
revolve = CAD.addRevolveAdvanced('revolve')
revolve.section = 'sketch'
revolve.dirtype = 'Pick'
revolve.dirshape = ('sketch001', 'Edge1')
revolve.reversed = False
revolve.pointtype = 'Link'
revolve.pointshape = ('sketch001', 'Edge1')
revolve.starttype = 'StartValue'
revolve.startdistance = 0
revolve.endtype ='EndValue'
revolve.enddistance = 360
revolve.solid = True
revolve.boolean = 'None'
revolve.generate()
CAD.getObject('sketch').setHide(True)
revolve = CAD.addRevolveAdvanced('revolve001')
revolve.section = 'sketch002'
revolve.dirtype = 'Pick'
revolve.dirshape = ('sketch001', 'Edge1')
revolve.reversed = False
revolve.pointtype = 'Link'
revolve.pointshape = ('sketch001', 'Edge1')
revolve.starttype = 'StartValue'
revolve.startdistance = 0
revolve.endtype ='EndValue'
revolve.enddistance = 360
revolve.solid = True
revolve.boolean = 'None'
revolve.generate()
CAD.getObject('sketch002').setHide(True)
revolve = CAD.addRevolveAdvanced('revolve002')
revolve.section = 'sketch001'
revolve.dirtype = 'Pick'
revolve.dirshape = ('sketch001', 'Edge1')
revolve.reversed = False
revolve.pointtype = 'Link'
revolve.pointshape = ('sketch001', 'Edge1')
revolve.starttype = 'StartValue'
revolve.startdistance = 0
revolve.endtype ='EndValue'
revolve.enddistance = 360
revolve.solid = True
revolve.boolean = 'None'
revolve.generate()
CAD.getObject('sketch001').setHide(True)
cylinder = CAD.addCylinder('cylinder')
cylinder.radius = 50
cylinder.height = 100
cylinder.angle = 360
cylinder.x = 0
cylinder.y = 80
cylinder.z = 0
cylinder.rotationAngle = 1.5707963
cylinder.rotationZ = 0
cylinder.rotationY = 0
cylinder.rotationX = 1
Window.setView('fitView')

geomList = [['revolve001', []]]
Mesh.createPartsComponent(comp_name = 'armature', geomNamelist = geomList)
geomList = [['revolve', []]]
Mesh.createPartsComponent(comp_name = 'coil', geomNamelist = geomList)
geomList = [['revolve002', []]]
Mesh.createPartsComponent(comp_name = 'fix', geomNamelist = geomList)
geomList = [['cylinder', []]]
Mesh.createPartsComponent(comp_name = 'air', geomNamelist = geomList)
geomList = [['cylinder', ['Face3', 'Face1', 'Face2']]]
Mesh.createPartsComponent(comp_name = 'boundary', geomNamelist = geomList)

gl.Table('dt4e')
table = gl.tables['dt4e']
table.interpolationType = InterpolationType.Linear
table.extrapolationType = ExtrapolationType.BHType2
table.argument = 'H'
table.outPutName = 'B'
table.setData( ( 0, 100, 201, 315, 401, 530, 645, 703, 817, 903, 1000, 2040, 3110, 4060, 5100, 6190, 7080, 8000, 80000, 800000, ), ( 0, 0.122, 0.402, 0.821, 1.03, 1.19, 1.3, 1.33, 1.39, 1.42, 1.46, 1.63, 1.7, 1.74, 1.78, 1.81, 1.83, 1.85, 1.851, 1.852, ) ) 

# gl.loadMaterial('air')
# gl.materials['air'].removeValue(MaterialProperty.AdvancedDensityType)
# gl.materials['air'].removeValue(MaterialProperty.BoussinesqDensity)
# gl.materials['air'].removeValue(MaterialProperty.ThermalExpansionCoefficient)
# gl.materials['air'].removeValue(MaterialProperty.MolecularWeight)
# gl.materials['air'].addType(MaterialType.Thermal)
# gl.materials['air'].setValue(MaterialProperty.KZZ, ValueType.Value,  26.24)
# gl.materials['air'].setValue(MaterialProperty.KYY, ValueType.Value,  26.24)
# gl.materials['air'].setValue(MaterialProperty.KXX, ValueType.Value,  26.24)
# gl.materials['air'].setValue(MaterialProperty.HCAPACITY, ValueType.Value,  1012000000)
# gl.materials['air'].removeType(MaterialType.IronLoss)
gl.Material('air')
gl.materials['air'].addType(MaterialType.Viscosity)
gl.materials['air'].setValue(MaterialProperty.Mu, ValueType.Value,  1.7894e-08)
gl.materials['air'].addType(MaterialType.BModulus)
gl.materials['air'].setValue(MaterialProperty.Bulk, ValueType.Value,  20000000)
gl.materials['air'].addType(MaterialType.Thermal)
gl.materials['air'].setValue(MaterialProperty.KZZ, ValueType.Value,  26.24)
gl.materials['air'].setValue(MaterialProperty.KYY, ValueType.Value,  26.24)
gl.materials['air'].setValue(MaterialProperty.KXX, ValueType.Value,  26.24)
gl.materials['air'].setValue(MaterialProperty.HCAPACITY, ValueType.Value,  1012000000)
gl.materials['air'].addType(MaterialType.Magnetic_MUR)
gl.materials['air'].setValue(MaterialProperty.MURX, ValueType.Value,  1)
gl.materials['air'].setValue(MaterialProperty.MURY, ValueType.Value,  1)
gl.materials['air'].setValue(MaterialProperty.MURZ, ValueType.Value,  1)
gl.materials['air'].setValue(MaterialProperty.Density, ValueType.Value,  1.225e-09)
gl.Material('dt4e')
gl.materials['dt4e'].addType(MaterialType.Magnetic_MUR)
gl.materials['dt4e'].setValue(MaterialProperty.MURX, ValueType.Table,  1)
gl.materials['dt4e'].setValue(MaterialProperty.MURY, ValueType.Table,  1)
gl.materials['dt4e'].setValue(MaterialProperty.MURZ, ValueType.Table,  1)
gl.materials['dt4e'].setValue(MaterialProperty.Density, ValueType.Value,  2e-07)
gl.materials['dt4e'].removeType(MaterialType.IronLoss)
gl.materials['dt4e'].value(MaterialProperty.Density).value = 2e-07
gl.materials['dt4e'].addType(MaterialType.Thermal)
gl.materials['dt4e'].setValue(MaterialProperty.KZZ, ValueType.Value,  20000)
gl.materials['dt4e'].setValue(MaterialProperty.KYY, ValueType.Value,  20000)
gl.materials['dt4e'].setValue(MaterialProperty.KXX, ValueType.Value,  20000)
gl.materials['dt4e'].setValue(MaterialProperty.HCAPACITY, ValueType.Value,  460000000)
gl.materials['dt4e'].setValue(MaterialProperty.Density, ValueType.Value,  7.5e-06)
gl.Material('coil')
gl.materials['coil'].addType(MaterialType.Thermal)
gl.materials['coil'].setValue(MaterialProperty.KZZ, ValueType.Value,  380000)
gl.materials['coil'].setValue(MaterialProperty.KYY, ValueType.Value,  380000)
gl.materials['coil'].setValue(MaterialProperty.KXX, ValueType.Value,  380000)
gl.materials['coil'].setValue(MaterialProperty.HCAPACITY, ValueType.Value,  380000000)
gl.materials['coil'].addType(MaterialType.Electro_RSV)
gl.materials['coil'].setValue(MaterialProperty.RSVZ, ValueType.Value,  0.00019025)
gl.materials['coil'].setValue(MaterialProperty.RSVY, ValueType.Value,  0.00019025)
gl.materials['coil'].setValue(MaterialProperty.RSVX, ValueType.Value,  0.00019025)
gl.materials['coil'].addType(MaterialType.Magnetic_MUR)
gl.materials['coil'].setValue(MaterialProperty.MURX, ValueType.Value,  1)
gl.materials['coil'].setValue(MaterialProperty.MURY, ValueType.Value,  1)
gl.materials['coil'].setValue(MaterialProperty.MURZ, ValueType.Value,  1)
gl.materials['coil'].setValue(MaterialProperty.Density, ValueType.Value,  8.95e-06)
Model.updateSolverList()
Model.updateSolverList()
# gl.materials['air'].removeValue(MaterialProperty.AdvancedDensityType)
# gl.materials['air'].removeValue(MaterialProperty.BoussinesqDensity)
# gl.materials['air'].removeValue(MaterialProperty.ThermalExpansionCoefficient)
# gl.materials['air'].addType(MaterialType.Thermal)
# gl.materials['air'].setValue(MaterialProperty.KZZ, ValueType.Value,  26.24)
# gl.materials['air'].setValue(MaterialProperty.KYY, ValueType.Value,  26.24)
# gl.materials['air'].setValue(MaterialProperty.KXX, ValueType.Value,  26.24)
# gl.materials['air'].setValue(MaterialProperty.HCAPACITY, ValueType.Value,  1012000000)
# gl.materials['air'].addType(MaterialType.Magnetic_MUR)
# gl.materials['air'].setValue(MaterialProperty.MURX, ValueType.Value,  1)
# gl.materials['air'].setValue(MaterialProperty.MURY, ValueType.Value,  1)
# gl.materials['air'].setValue(MaterialProperty.MURZ, ValueType.Value,  1)
# gl.materials['air'].removeType(MaterialType.IronLoss)
# gl.materials['air'].removeValue(MaterialProperty.MolecularWeight)

Model.updateSolverList()
Model.updateSolverList()
Model.Model('model_1')
Model.models['model_1'].typeName = 'Thermal'
Model.models['model_1'].importComponent('armature')
Model.models['model_1'].importComponent('coil')
Model.models['model_1'].importComponent('fix')
Model.models['model_1'].importComponent('air')
Model.models['model_1'].importComponent('boundary')
Model.models['model_1'].componentList.at(0).materialId = 3
Model.models['model_1'].componentList.at(1).materialId = 4
Model.models['model_1'].componentList.at(2).materialId = 3
Model.models['model_1'].componentList.at(3).materialId = 2
bc = Model.BoundaryCondition()
bc.type = 'Temperature'
bc.compId = 5
bc.value('TEMP').value = 20
bc.value('TEMP').type = ValueType.Value
bc.shellTDOF = 'TEMP'
Model.models['model_1'].bcList.append(bc)
bc = Model.BoundaryCondition()
bc.type = 'HeatGeneration'
bc.compId = 2
bc.value('HEATD').value = 433.1047601
bc.value('HEATD').type = ValueType.Value
bc.shellTDOF = 'TEMP'
Model.models['model_1'].bcList.append(bc)

Mesh.setLocalSeed(part = 'revolve', sub_list = ['Edge1', 'Edge2', 'Edge3', 'Edge4', 'Edge5', 'Edge6'], size = 0.5)
Mesh.setLocalSeed(part = 'revolve002', sub_list = ['Edge1', 'Edge2', 'Edge3', 'Edge4', 'Edge5', 'Edge6', 'Edge7', 'Edge8', 'Edge9', 'Edge10', 'Edge11', 'Edge12', 'Edge13', 'Edge14', 'Edge15', 'Edge16', 'Edge17', 'Edge18', 'Edge19', 'Edge20', 'Edge21', 'Edge22', 'Edge23', 'Edge24', 'Edge25', 'Edge26', 'Edge27'], size = 0.5)
Mesh.setLocalSeed(part = 'revolve001', sub_list = ['Edge1', 'Edge2', 'Edge3', 'Edge4', 'Edge5', 'Edge6', 'Edge7', 'Edge8', 'Edge9', 'Edge10', 'Edge11', 'Edge12', 'Edge13', 'Edge14', 'Edge15'], size = 0.5)
Mesh.setLocalSeed(part = 'cylinder', sub_list = ['Edge3', 'Edge2', 'Edge1'], size = 5)
holeDataList = []

# Mesh.createSharedTopoMeshBand(listFullName = ['revolve001.Solid1', 'revolve.Solid1', 'revolve002.Solid1', 'cylinder.Solid1'], additionGeomList = [], bandFullName = [], holeList = holeDataList, bandMotionType = 0, sharedTopoMeshType = 3, elemType = 'ETri', order = 1, tolerance = 0)
# Model.updateSolverList()

